import fetch from './request.js'

const api = {}
// api.baseUrl = 'https://haocheyishengstore.autoafs.com/prod-api' //正式 
// api.baseUrl = 'http://8.142.155.9:8083' //测试  
// api.baseUrl = 'http://49.235.162.157:8083' //正式
// api.baseUrl = 'https://shejihenmang.cn/prod-api' //域名   
api.baseUrl = 'http://192.168.10.180:8083'
// api.baseUrl = 'http://yutongbo.natapp1.cc' 
// 注册获取验证码
// 参数 地址 实体 请求方式   true 'application/x-www-form-urlencoded' : 'application/json',  是否隐藏加载框
//type, hideLoading

// 获取字典表
api.system = params => fetch.request(`/api/dict/fineList`, params, "post", true, true)

// ------------------------------------------------首页---------------------------------------------------------

// 获取轮播图
api.bannerList = params => fetch.request(`/api/home/bannerList`, params, "post", false, true)

// 推荐作品列表
api.recommendWorksList = params => fetch.request(`/api/home/recommendWorksList`, params, "post", false, true)

// 作品详情
api.worksDetail = params => fetch.request(`/api/home/worksDetail/${params.id}`, {}, "get", false, true)

// 作品分类列表
api.worksCategoryList = params => fetch.request(`/api/home/worksCategoryList`, params, "post", false, true)

// 作品列表
api.worksList = params => fetch.request(`/api/home/worksList`, params, "post", false, true)

// 根据code获取协议
api.getCodeAgreement = params => fetch.request(`/api/home/getCodeAgreement/${params.code}`, {}, "get", false, true)




// -------------------------------------------------------------登录-----------------------------------------------------------
// 获取用户信息
api.getUserInfo = params => fetch.request(`/api/getUserInfo`, params, "post", false, true)

// 修改用户信息
api.updateUserInfo = params => fetch.request(`/api/updateUserInfo`, params, "post", false, true)

// 获取openId or 查询是否已注册
api.getWxOpenId = params => fetch.request(`/api/getWxOpenId`, params, "post", true, true)

// 获取sessionKey
api.initWxLogin = params => fetch.request(`/api/initWxLogin`, params, "post", true, true)

// 登录
api.login = params => fetch.request(`/api/login`, params, "post", false, true)

// 生成邀请码
api.generateInvitationCode = params => fetch.request(`/api/generateInvitationCode`, params, "post", false, true)


// -------------------------------------------------------------合伙人-----------------------------------------------------------
// 申请合伙人
api.applyPartner = params => fetch.request(`/api/partner/applyPartner`, params, "post", false, true)

// 查询合伙人申请记录
api.getPartnerRecord = params => fetch.request(`/api/partner/getPartnerRecord`, params, "post", false, true)


// -------------------------------------------------------------邀请-----------------------------------------------------------
// 我的邀请
api.myInvitationList = params => fetch.request(`/api/invitation/myInvitationList`, params, "post", false, true)

// 推广排名
api.promotionRankingList = params => fetch.request(`/api/invitation/promotionRankingList`, params, "post", false, true)

// 我的邀推广排名 
api.myPromotionRanking = params => fetch.request(`/api/invitation/myPromotionRanking`, params, "post", false, true)



// -------------------------------------------------------------提现相关-----------------------------------------------------------
// 查询用户提现账号列表
api.withdrawalAccountList = params => fetch.request(`/api/withdrawal/withdrawalAccountList`, params, "post", false, true)

// 获取用户提现账号详情
api.withdrawalAccountDetail = params => fetch.request(`/api/withdrawal/withdrawalAccountDetail/${params}`, {}, "get", false, true)

// 新增用户提现账号
api.addWithdrawalAccount = params => fetch.request(`/api/withdrawal/addWithdrawalAccount`, params, "post", false, true)

// 修改用户提现账号
api.editWithdrawalAccount = params => fetch.request(`/api/withdrawal/editWithdrawalAccount`, params, "post", false, true)

// 删除用户提现账号
api.deleteWithdrawal = params => fetch.request(`/api/withdrawal/deleteWithdrawal`, params, "post", true, true)

// 用户提现
api.addWithdrawal = params => fetch.request(`/api/withdrawal/addWithdrawal`, params, "post", false, true)

// 提现记录
api.withdrawalRecordList = params => fetch.request(`/api/withdrawal/withdrawalRecordList`, params, "post", false, true)

// 提现记录详情
api.withdrawalRecordDetail = params => fetch.request(`/api/withdrawal/withdrawalRecordDetail`, params, "post", true, true)

// 钱包明细列表
api.walletRecordList = params => fetch.request(`/api/withdrawal/walletRecordList`, params, "post", false, true)



// -------------------------------------------------------------订单相关-----------------------------------------------------------
// 订单列表
api.orderList = params => fetch.request(`/api/order/orderList`, params, "post", false, true)

// 订单详情
api.orderDetail = params => fetch.request(`/api/order/orderDetail/${params.id}`, {}, "get", false, true)

// 订单支付首款
api.payStartOrder = params => fetch.request(`/api/order/payStartOrder`, params, "post", true, true)

// 订单支付尾款
api.payEndOrder = params => fetch.request(`/api/order/payEndOrder`, params, "post", true, true)

// 根据节点查看节点记录
api.speedShowApi = params => fetch.request(`/api/order/getOrderNodeRecordList`, params, "post", false, true)





export default api